<!-- 继承公共模板 -->
@extends('news.newslayout')
@section('style')
    <link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
    <style type="text/css">
        .astyle th,td{
            text-align:center;
        }

        td a{
            margin-left:10px;
        }
    </style>
@stop
<!-- 替换首页的title -->
@section('title')
    首页
@stop

<!-- 替换首页的内容区 -->
@section('content')
{{--获取当前的url路径--}}
    {{--Request::getPathInfo()--}}
    <!-- 引入其他页面 -->
    @include('news.alert')
    <div class=" table-responsive" style="margin-top:50px;">
        <table class="table table-bordered table-hover ">
                <thead>
                    <tr class="astyle">
                        <th>id</th>
                        <th>标题</th>
                        <th>内容</th>
                        <th>是否显示</th>
                        <th>创建时间</th>
                        <th>修改时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach($news_res as $v)
                        <tr class="active astyle">
                            <td>{{$v->id}}</td>
                            <td>{{$v->title}}</td>
                            <td>{{$v->content}}</td>
                            <td>{{$v->is_show == 1?'是':'否'}}</td>
                            <td>{{date($v->created_at)}}</td>
                            <td>{{date($v->updated_at)}}</td>
                            <td>
                                <a href="{{url('news/update',['id'=>$v->id])}}"><button type="button"><i class="glyphicon glyphicon-pencil">编辑</i></button></a>
                                <a href="{{url('news/delete',['id'=>$v->id])}}" onclick="if(confirm('确定删除吗？')==false) return false;"> <button type="button"><i class="glyphicon glyphicon-trash">删除</i></button></a>
                            </td>
                        </tr>
                    @endforeach
            </tbody>
        </table>
        <!-- 翻页 -->
        <div style="float:right;">
            {{$news_res->render()}}
        </div>
    </div>
@stop